<local:DocumentBase x:Class="WPFExcelReport.WorkFlowDocument"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"  
                    Loaded="Window_Loaded"
                  >

    <local:DocumentBase.Resources>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <CollectionViewSource  x:Key="vwMaster" Source="{Binding Path=SetMaster.ICC_WFEVENTS}"/>
        <CollectionViewSource  x:Key="vwDetail" Source="{Binding Path=SetDetail.ICC_WFEVENTS}"/>
        <CollectionViewSource  x:Key="vwEvents" Source="{Binding Path=SetEnv.ICC_WFEVENTDEF}"/>
        <CollectionViewSource  x:Key="vwHRSTAMM" Source="{Binding Path=SetEnv.HRSTAMM}"/>
        <CollectionViewSource  x:Key="vwFunction" Source="{Binding Path=SetEnv.ICC_FUNCTIONS}"/>
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
        </Grid.RowDefinitions> 
        <StackPanel Grid.Row="0"   Margin="0,0,-0.2,0">
            <Expander  
                Name="expLog" ExpandDirection="Down" IsExpanded="True">
                <StackPanel>
                    <WrapPanel Name="zoneCommand" Margin="4,0,51,6" Grid.ColumnSpan="3">
                        <Label Content="{Binding Source={Localization:TranslateExtension Word=系统}}" Width="Auto" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <TextBox Name="txtMANDANT" MaxLength="2" Width="40" Margin="10,0,0,0"   HorizontalAlignment="Left" Background="Pink"  TabIndex="1" >00</TextBox>
                        <Label Content="{Binding Source={Localization:TranslateExtension Word=语言}}" Width="Auto" Margin="0,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                        <TextBox IsReadOnly="True" Name="txtSPRACHKZ" Width="40" Margin="0,0,0,0" Text="" MaxLength="1" HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="2" />
                        <Label Content="{Binding Source={Localization:TranslateExtension Word=用户名}}" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                        <TextBox Name="txtUserID" Width="120" Margin="10,0,0,0" Text="" HorizontalAlignment="Left" Background="Yellow" FontSize="18" MaxLength="8" AcceptsTab="False" CharacterCasing="Upper" KeyboardNavigation.TabIndex="0" TabIndex="3" />
                        <Label Content="{Binding Source={Localization:TranslateExtension Word=密码}}" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                        <PasswordBox Name="txtPassword" Width="120" Margin="10,0,0,0" HorizontalAlignment="Left" Background="Yellow"  KeyboardNavigation.TabIndex="1" TabIndex="4" />
                        <Button Content="{Binding Source={Localization:TranslateExtension Word=登录}}" Height="Auto" Margin="10,0,0,0" Name="btnLogIn" Width="Auto" Click="btnLogIn_Click" KeyboardNavigation.TabIndex="2" IsDefault="True" TabIndex="5">

                        </Button>
                        <TextBlock Name="Administration"></TextBlock>
                        <CheckBox FontSize="14" Content="{Binding Source={Localization:TranslateExtension Word=属于评审组}}" Name="IsBelongs2V9"
                              Visibility="Hidden"></CheckBox>
                        <TextBlock FontSize="14" MinWidth="200" Width="Auto" Name="MemberV9" Background="#FF00AF00"
                               Visibility="Hidden"></TextBlock>
                        <TextBlock Name="txtLogIn" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left" Background="White" FontSize="14" KeyboardNavigation.TabIndex="1" />
                    </WrapPanel>
                </StackPanel>
            </Expander>
            <WrapPanel Name="ZoneManager"></WrapPanel>
            <WrapPanel Name="ZoneIT"></WrapPanel>
            <WrapPanel Name="ZoneNormal"></WrapPanel>
            <WrapPanel >
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=刷新}}" Click="Load_Click"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=处理}}" Click="Edit_Click"></Button>
                <Button Width="Auto" Visibility="{Binding IsMaster, Converter={StaticResource ResourceKey=bv}}" HorizontalAlignment="Left"  Click="Delete_Click" Content="{Binding Source={Localization:TranslateExtension Word=删除}}" Margin="10,0,0,0"/>
                <Button Width="Auto" Visibility="{Binding IsMaster, Converter={StaticResource ResourceKey=bv}}" HorizontalAlignment="Left"  Click="DeleteSameSource_Click" Content="{Binding Source={Localization:TranslateExtension Word=删除相同情况}}" Margin="10,0,0,0"/>
                    
                    <!--Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=新建}}" Click="New_Click"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=复制}}" Click="Copy_Click"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=全部复制}}" Click="CopyAll_Click"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=保存}}" Click="Save_Click"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=取消}}" Click="butDiscard_Click"></Button-->
                 
            </WrapPanel>
            <WrapPanel>
                <TextBlock Text="{Binding Source={Localization:Translate Word=勾选则未完成}}"></TextBlock>
                <CheckBox Name="ChkWFSTATUS" IsChecked="False" VerticalAlignment="Center" 
                          Background="White"
                          >
                    <CheckBox.LayoutTransform>
                        <ScaleTransform ScaleX="2" ScaleY="2" />
                    </CheckBox.LayoutTransform>
                </CheckBox>
                <TextBlock Text="{Binding Source={Localization:Translate Word=仅拒绝}}"></TextBlock>
                <CheckBox Name="ChkWFSTATUSJJ" IsChecked="False" VerticalAlignment="Center" 
                          Background="White"
                          >
                    <CheckBox.LayoutTransform>
                        <ScaleTransform ScaleX="2" ScaleY="2" />
                    </CheckBox.LayoutTransform>
                </CheckBox>
                <TextBlock Text="{Binding Source={Localization:Translate Word=用户}}"></TextBlock>
                <TextBox Background="White"   HorizontalAlignment="Left" Margin="3"  VerticalAlignment="Center" Width="40" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=用户组}}"></TextBlock>
                <TextBox   HorizontalAlignment="Left" Margin="3" 
                                   Text="{Binding Path=USERGROUP, Source={StaticResource ResourceKey=vwDetail}}" VerticalAlignment="Center" Width="60" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=订单}}"></TextBlock>
                <TextBox Name="txtKRS" Background="White"   HorizontalAlignment="Left" Margin="3"  VerticalAlignment="Center" Width="40" />
                <TextBox Name="txtLFD" Background="White"   HorizontalAlignment="Left" Margin="3"  VerticalAlignment="Center" Width="60" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=事件}}"></TextBlock>
                <TextBox Name="txtEvents"  Background="White"   HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" Width="120" />
                <ComboBox   
                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwEvents}}"
                   SelectionChanged="EVENTS_SelectionChanged"
                    Background="Gray"  MinWidth="100"  
                    DisplayMemberPath="WFEDES"
                    IsEditable="True"
                    SelectedValuePath="WFEVENTS"
                    >
                </ComboBox>
            </WrapPanel>           
        </StackPanel>
        <Grid Grid.Row="1" Grid.Column="0"  >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Source={Localization:Translate Word=源头}}"></TextBlock>
            <TextBox   Grid.Row="1" Grid.Column="0"  Margin="3"   Height="50" HorizontalAlignment="Stretch"
                                   Text="{Binding Path=WFSOURCE, Source={StaticResource ResourceKey=vwMaster},Converter={StaticResource ResourceKey=gb2312}}" VerticalAlignment="Center"  
                         
                          />
            <TextBlock  Grid.Row="0" Grid.Column="1" Text="{Binding Source={Localization:Translate Word=事件}}" HorizontalAlignment="Stretch"></TextBlock>
            <TextBox   Grid.Row="1" Grid.Column="1"   Margin="3" Height="50" FontSize="12" HorizontalAlignment="Stretch"
                                   Text="{Binding Path=WHAT, Source={StaticResource ResourceKey=vwMaster},Converter={StaticResource ResourceKey=gb2312}}" VerticalAlignment="Center"  />
            <TextBox    Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="3" Height="100" FontSize="12" HorizontalAlignment="Stretch"
                                   Text="{Binding Path=WHAT, Source={StaticResource ResourceKey=vwMaster}}" VerticalAlignment="Center"    />
        </Grid>
        
       <DataGrid   Grid.Row="2" Grid.Column="0"  
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                              HeadersVisibility="Column"                           
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                MaxHeight="500"
                   FontSize="12"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" 
                Margin="0,0,0,0" 
                              >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ROWNID}" Header="{Binding Source={Localization:Translate Word=ID}}"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=CONTROL}" Header="{Binding Source={Localization:Translate Word=状态}}"   Width="Auto"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=WFEUSER,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=用户}}"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=WFEVENTS}" Header="{Binding Source={Localization:Translate Word=事件}}"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=WHAT, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=描述}}"  Width="120" MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=HOW, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=请求}}"  Width="120" MinWidth="80"/>
                    <DataGridTextColumn Binding="{Binding Path=KRS}"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=LFD}" Header="{Binding Source={Localization:Translate Word=订单}}"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="{Binding Source={Localization:Translate Word=品种}}"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=COLOR}" Header="{Binding Source={Localization:Translate Word=色号}}"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=WFSOURCE}" Header="{Binding Source={Localization:Translate Word=来源}}"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=WFEHANDLER}" Header="{Binding Source={Localization:Translate Word=处理}}"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=NEWUSER}" Header="{Binding Source={Localization:Translate Word=创建者}}"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=NEWTIME}" Header="{Binding Source={Localization:Translate Word=创建日期}}"  Width="Auto" MinWidth="40"/>
                </DataGrid.Columns>
            </DataGrid>
     

    </Grid>
</local:DocumentBase>
